package com.jk.mindskip.controller;

import com.jk.mindskip.dto.TbStudent;
import com.jk.mindskip.interfaces.TbStudentServiceApi;
import com.jk.mindskip.pojo.PagedResponse;
import com.jk.mindskip.service.TbStudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class TbStudentController implements TbStudentServiceApi {


    @Autowired
    private TbStudentService tbStudentService;
    @Override
    public TbStudent findTbStudentByUsername(String username) {
        return tbStudentService.findTbStudentByUsername(username);
    }

    @Override
    public PagedResponse findStudentList(TbStudent tbStudent, Integer pageNum, Integer pageSize) {
        return tbStudentService.findStudentList(tbStudent,pageNum,pageSize);
    }

    @Override
    public void addStudent(TbStudent tbStudent) {
        tbStudentService.addStudent(tbStudent);
    }

    @Override
    public void deleteById(Integer id) {
        tbStudentService.deleteById(id);
    }

    @Override
    public void updateStudent(TbStudent tbStudent) {
        tbStudentService.updateStudent(tbStudent);
    }

    @Override
    public void deleteStudentByIds(List<Integer> ids) {
        tbStudentService.deleteStudentByIds(ids);
    }

}
